@model VotingSystem.Models.SurveyResponse

@{
    ViewData["Title"] = "提交者作答";
}

<div class="container">
    <h2>提交者作答</h2>
    <p>提交时间：@Model.SubmitTime.ToString("yyyy-MM-dd HH:mm:ss")</p>

    <div class="card mb-4">
        <div class="card-body">
            <h3 class="card-title">问题作答</h3>
            @foreach (var questionResponse in Model.QuestionResponses)
            {
                <div class="card mb-3">
                    <div class="card-header">
                        <h5>@(questionResponse.Question?.QuestionText ?? "未知问题")</h5>
                    </div>
                    <div class="card-body">
                        @if (questionResponse.Question?.Type == QuestionType.Text)
                        {
                            <p>作答：@questionResponse.TextResponse</p>
                        }
                        else if (questionResponse.Question?.Type == QuestionType.Rating)
                        {
                            <p>评分：@questionResponse.RatingResponse</p>
                        }
                        else
                        {
                            <ul class="list-group">
                                @foreach (var selectedOption in questionResponse.SelectedOptions)
                                {
                                    <li class="list-group-item">@selectedOption.Option?.OptionText</li>
                                }
                            </ul>
                        }
                    </div>
                </div>
            }
        </div>
    </div>
</div> 